import React, { Component } from 'react'
import ISlOGIG from '../utils/islogin';
import RouterView from '../router/routerView'
import { Layout, Menu } from 'antd';
import {NavLink} from "react-router-dom"
import {
  MenuUnfoldOutlined,
  MenuFoldOutlined,
  UserOutlined,
  VideoCameraOutlined,
  UploadOutlined,
} from '@ant-design/icons';
const { Header, Sider, Content } = Layout;
 class All extends Component {
    state = {
        collapsed: false,
      };
    
      toggle = () => {
        this.setState({
          collapsed: !this.state.collapsed,
        });
      };
  render() {
    console.log(this.props,11111)
    return (
      
           <Layout>
        <Sider trigger={null} collapsible collapsed={this.state.collapsed}>
          <div className="logo" />
          <Menu
            theme="dark"
            mode="inline"
            defaultSelectedKeys={['1']}
            items={[
              {
                key: '1',
                icon: <UserOutlined />,
                label: <NavLink to="/all/class">班级管理</NavLink>,
              },
              {
                key: '2',
                icon: <VideoCameraOutlined />,
                label: <NavLink to="/all/test">考试管理</NavLink>,
              },
              {
                key: '3',
                icon: <UploadOutlined />,
                label: 'nav 3',
              },
            ]}
          />
        </Sider>
        <Layout className="site-layout">
          <Header className="site-layout-background" style={{ padding: 0 }}>
               <span>{window.localStorage.getItem("username")}</span>
          </Header>
          <Content
            className="site-layout-background"
            style={{
              margin: '24px 16px',
              padding: 24,
              minHeight: 280,
            }}
          >
                <RouterView RouterList={this.props.child}></RouterView>
          </Content>
        </Layout>
      </Layout>
     
    )
  }
}

export default ISlOGIG(All)